package com.zzsz.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zzsz.common.annotation.Excel;
import com.zzsz.common.core.domain.BaseEntity;

/**
 * 记录各商品在不同仓库的库存数量及相关信息对象 zzsz_inventory
 *
 * @author ruoyi
 * @date 2025-09-02
 */
public class ZzszInventory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long inventoryId;

    /** 商品ID */
    @Excel(name = "商品ID")
    private Long productId;

    /** 仓库ID */
    @Excel(name = "仓库ID")
    private final Long warehouseId=1L;

    /** 库存数量 */
    @Excel(name = "库存数量")
    private Long quantity;

    /** 锁定数量（如已下单但未付款） */
    @Excel(name = "锁定数量", readConverterExp = "如=已下单但未付款")
    private Long lockedQuantity;

    /** 可用库存 */
    @Excel(name = "可用库存")
    private Long availableQuantity;

    /** 最后入库时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后入库时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastStockInTime;

    /** 最后出库时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后出库时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastStockOutTime;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Date createdAt;

    /** $column.columnComment */
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Date updatedAt;

    public void setInventoryId(Long inventoryId)
    {
        this.inventoryId = inventoryId;
    }

    public Long getInventoryId()
    {
        return inventoryId;
    }

    public void setProductId(Long productId)
    {
        this.productId = productId;
    }

    public Long getProductId()
    {
        return productId;
    }

    public Long getWarehouseId()
    {
        return warehouseId;
    }

    public void setQuantity(Long quantity)
    {
        this.quantity = quantity;
    }

    public Long getQuantity()
    {
        return quantity;
    }

    public void setLockedQuantity(Long lockedQuantity)
    {
        this.lockedQuantity = lockedQuantity;
    }

    public Long getLockedQuantity()
    {
        return lockedQuantity;
    }

    public void setAvailableQuantity(Long availableQuantity)
    {
        this.availableQuantity = availableQuantity;
    }

    public Long getAvailableQuantity()
    {
        return availableQuantity;
    }

    public void setLastStockInTime(Date lastStockInTime)
    {
        this.lastStockInTime = lastStockInTime;
    }

    public Date getLastStockInTime()
    {
        return lastStockInTime;
    }

    public void setLastStockOutTime(Date lastStockOutTime)
    {
        this.lastStockOutTime = lastStockOutTime;
    }

    public Date getLastStockOutTime()
    {
        return lastStockOutTime;
    }

    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("inventoryId", getInventoryId())
                .append("productId", getProductId())
                .append("warehouseId", getWarehouseId())
                .append("quantity", getQuantity())
                .append("lockedQuantity", getLockedQuantity())
                .append("availableQuantity", getAvailableQuantity())
                .append("lastStockInTime", getLastStockInTime())
                .append("lastStockOutTime", getLastStockOutTime())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .toString();
    }
}
